// 2025/9/18
// 赎金信

class Solution {
public:
    bool canConstruct(string ransomNote, string magazine) {
        vector<int> ch_num(26, 0);
        for(auto& ch : magazine)
        {
            ch_num[ch - 'a']++;
        }

        for(auto& ch : ransomNote)
        {
            if(--ch_num[ch - 'a'] < 0)
                return false;
        }
        return true;
    }
};